import type { ComponentImpWithoutMethods } from "@/components/low-code/core/index";


export const componentSchema: ComponentImpWithoutMethods[] = [
  {
    key: "",
    component: "root",
    name: "根容器",
    field: "",
    selector: "",
    group: "page",
    describe: "",
    nestedChain: "",
    componentProps: {
      gridTemplateColumns:  3,
      ref: null,
      labelWidth: 100,
      labelPosition: "left",
      size: "default",
    },
    items: [],
  },
  //group:'base'
  {
    key: "",
    component: "button",
    name: "按钮",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      name: "按钮",
      actionType: "",
      messageCode: "",
      onClickEvents: [],
    },
  },
  {
    key: "",
    component: "actionBar",
    name: "操作组",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      align:  "flex-start",
      buttonGroups: [
        {
          name: "按钮1",
          type:"primary"
        },
        {
          name: "按钮2",
          type:"default"
        },
      ],
    },
  },
  {
    key: "",
    component: "input",
    name: "输入框",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      label: "label",
      value: "",
      onChangeEvents: [],
      onFocusEvents: [],
      required: false,
      rules: [],
    },
  },
  {
    key: "",
    component: "select",
    name: "下拉框",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      label: "label",
      value: "",
      dataSourceType:'1',
      required: false,
      rules: [],
      onChangeEvents: [],
    },
  },
  {
    key: "",
    component: "date",
    name: "日期选择器",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      label: "label",
      value: "",
      onChangeEvents: [],
      onFocusEvents: [],
      required: false,
      rules: [],
    },
  },
  {
    key: "",
    component: "radio",
    name: "单选框",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      label: "label",
      value: "",
      required: false,
      rules: [],
      onChangeEvents: [],
    },
  },
  {
    key: "",
    component: "html",
    name: "HTML",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      title: "HTML",
      value: `<div style="color:red">自定义文本<div>`,
    },
  },
  {
    key: "",
    component: "table",
    name: "表格",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      label: "label",
      pagination:false,
      columns: [
        { prop: "name", label: "姓名" },
        { prop: "age", label: "年龄" },
        { prop: "address", label: "地址" },
      ],
      tableData: [
        { id: 1, name: '张三', age: 20, address: '北京' },
        { id: 2, name: '李四', age: 25, address: '上海' },
        { id: 3, name: '王五', age: 30, address: '广州' }
      ],
    },
  },
  {
    key: "",
    component: "upload",
    name: "上传",
    field: "",
    selector: "",
    group: "base",
    describe: "",
    nestedChain: "",
    componentProps: {
      name: "上传",
    },
  },

  // group:'container'
  {
    key: "",
    component: "form",
    name: "表单域",
    field: "",
    selector: "",
    group: "container",
    describe: "",
    nestedChain: "",
    componentProps: {
      gridTemplateColumns:  3,
      ref: null,
      labelWidth: 100,
      labelPosition: "left",
      size: "default",
    },
    items: [],
  },
  {
    key: "",
    component: "card",
    name: "卡片",
    field: "",
    selector: "",
    group: "container",
    describe: "",
    nestedChain: "",
    componentProps: {
      header: "卡片标题",
    },
    items: [],
  },
  {
    key: "",
    component: "tabs",
    name: "标签页",
    field: "",
    selector: "",
    group: "container",
    describe: "",
    nestedChain: "",
    componentProps: {
      defaultActiveKey: 0,
    },
    items: [
      {
        key: "NCQTYZGR",
        tabIndex: 0,
        component: "tab",
        name: "标签页1",
        componentProps: {},
        items: [],
      },
      {
        key: "NCQLYZGJ",
        tabIndex: 1,
        component: "tab",
        name: "标签页2",
        componentProps: {},
        items: [],
      },
    ],
  },
  {
    key: "",
    component: "collapse",
    name: "折叠面板",
    field: "",
    selector: "",
    group: "container",
    describe: "",
    nestedChain: "",
    componentProps: {
      defaultActiveKey: 0,
    },
    items: [
      {
        key: "NCQZYZGR",
        tabIndex: 0,
        component: "collapseItem",
        name: "折叠标题1",
        componentProps: {},
        items: [],
      },
      {
        key: "NCQZYZGJ",
        tabIndex: 1,
        component: "collapseItem",
        name: "折叠标题2",
        componentProps: {},
        items: [],
      },
    ],
  },
  {
    key: "",
    component: "row",
    name: "格栅",
    field: "",
    selector: "",
    group: "container",
    describe: "",
    nestedChain: "",
    componentProps: {
      gutter: 10,
    },
    items: [
      {
        key: "NCQZYZGB",
        component: "col",
        componentProps: {
          span: 12,
          offset: 0,
        },
        items: [],
      },
      {
        key: "RSBQFXGA",
        component: "col",
        componentProps: {
          span: 12,
          offset: 0,
        },
        items: [],
      },
    ],
  },
  {
    key: "",
    component: "dialog",
    name: "弹框",
    field: "",
    selector: "",
    group: "container",
    describe: "",
    nestedChain: "",
    componentProps: {
      params: [
        {
          key: "id",
          origin: "",
          value: "",
        },
      ],
      visible: true,
      title: "弹框",
      alias: "dialog",
      onShowEvents: [],
      onHideEvents: [],
    },
    items: [],
  },
];


